package nc.bs.hrhi.bp;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import nc.jdbc.framework.processor.MapListProcessor;
import nc.vo.pub.BusinessException;
import nc.vo.pubapp.pattern.pub.SqlBuilder;

public class QueryQysDefaultInfoBp extends AbsPubOp{

	public Map<String, Map<String, String>> exec(String[] pk_psndocs) throws BusinessException{
		
		SqlBuilder sqlB = new SqlBuilder();
		sqlB.append(" select bd_psndoc.pk_psndoc as pk_psndoc, view_smg_psncl.name as yglb, view_smg_postGrade.code as zj, view_smg_joborgs.name as orgname  ");
		sqlB.append(" from bd_psndoc ");
		sqlB.append(" left join view_smg_psncl on view_smg_psncl.pk_psndoc=bd_psndoc.pk_psndoc ");
		sqlB.append(" left join view_smg_postGrade on view_smg_postGrade.pk_psndoc=bd_psndoc.pk_psndoc ");
		sqlB.append(" left join view_smg_joborgs on view_smg_joborgs.pk_psndoc=bd_psndoc.pk_psndoc  ");
		sqlB.append(" where bd_psndoc.pk_psndoc ", pk_psndocs);
		
		List<Map<String, String>> list = (List<Map<String, String>>) getDao().executeQuery(sqlB.toString(), new MapListProcessor());
		
		if(list != null && list.size() > 0) {
			Map<String, Map<String, String>> result = new HashMap<String, Map<String,String>>();
			for(Map<String, String> map : list) {
				result.put(map.get("pk_psndoc"), map);
			}
			
			return result;
		}
		
		return null;
	}
	
}
